<template>
  <el-dialog title="分配角色" :close-on-click-modal="false" :visible="showRoleDialog" @close="btnCancel">
    <!-- el-checkbox-group选中的是 当前用户所拥有的角色  需要绑定 当前用户拥有的角色-->
 
 <template>
    <el-radio v-model="radio" label="1">渡石运营</el-radio>
    <el-radio v-model="radio" label="2">公司管理员</el-radio>
    <el-radio v-model="radio" label="3">子组织</el-radio>
    <el-radio v-model="radio" label="4">岗位</el-radio>
 </template>
    <el-row slot="footer" type="flex" justify="center">
      <el-col :span="6">
        <el-button type="primary" size="small" @click="btnOk">确定</el-button>
        <el-button size="small" @click="btnCancel">取消</el-button>
      </el-col>
    </el-row>
  </el-dialog>
</template>

<script>
export default {
  props: {
    showRoleDialog: {
      type: Boolean,
      default: false
    },
    // 用户的id 用来查询当前用户的角色信息
    userId: {
      type: String,
      default: null
    }
  },
  data() {
    return {
      radio:'1',
      list: [],
      roleIds: [] // 定义当前选中的数组变量
    }
  },
  created() {
    // this.getsetting()
  },
  methods: {
    async getsetting() {
      // const { rows } = await getsetting()
      // this.list = rows
    },
    async getUserDetailById(id) {
      // const { roleIds } = await getUserDetailById(id)
      // this.roleIds = roleIds
    },
    // 确定按钮
    async btnOk() {
      // await assignRoles({ id: this.userId, roleIds: this.roleIds })
      // //   关闭窗体
      // this.$emit('update:showRoleDialog', false)
    },
    btnCancel() {
      this.roleIds = [] // 清空原来的数组
      this.$emit('update:showRoleDialog', false)
    }

  }
}
</script>
